home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.cs.arizona.edu
/
ftp.cs.arizona.edu.tar
/
ftp.cs.arizona.edu
/
icon
/
newsgrp
/
group96a.txt
/
000062_icon-group-sender _Mon Mar 4 20:58:38 1996.msg
< prev
next >
Wrap
Internet Message Format
|
1996-09-05
|
2KB
Received: by cheltenham.cs.arizona.edu; Mon, 4 Mar 1996 16:21:13 MST
From: "Hamish Lawson" <H.Lawson@tees.ac.uk>
Organization: University of Teesside (SCM)
To: icon-group@cs.arizona.edu
Date: Mon, 4 Mar 1996 20:58:38 GMT0BST
Subject: Production of an operator's left-hand operand
Reply-To: H.Lawson@tees.ac.uk
Priority: normal
X-Mailer: Pegasus Mail for Windows (v2.0-WB2)
Message-Id: <B461B2458B@scm_arkengarthdale.tees.ac.uk>
Errors-To: icon-group-errors@cs.arizona.edu
Status: O
I understand the logic behind having operators produce their
right-hand operand, in order that we can do stuff like
if x < y < z then
However I frequently want to have the right-hand operand produced,
e.g to print x only if it is greater than 5 I cannot say
write(x > 5)
but must instead say
write(5 < x)
Aside from the slight artificiality in such a construct this
rearrangement may not work (and correct me if I'm wrong) if I want to
do something like printing the value of e1 only if e2 succeeds; that
is, I cannot necessarily rewrite this as
write(e2 & e1)
Want would be nice would be parallel operators that produce their
left-hand operand; a possible notation would be to prefix the
standard operator with a ^ (there may be better schemes, perhaps a
suffix ~):
write(e1 ^& e2) # produces e1 only if e2 succeeds
Aside from the usual problems of getting a new feature adopted in a
language, are their any other problems with such an idea?
| Hamish Lawson, School of Computing and Mathematics,
| University of Teesside, Middlesbrough, Cleveland, UK, TS1 3BA
| Tel: +44 1642 218121 x3611 Fax: +44 1642 342604
| E-mail: H.Lawson@tees.ac.uk